# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-booby-ng
_pkgname=booby-ng
pkgver=0.8.4
pkgrel=9
pkgdesc='Data modeling and validation Python library.'
url='https://pypi.org/project/booby-ng/#files'
arch=('any')
license=('Apache')
depends=('python')
makedepends=('python-pip' 'python-wheel' 'python-build')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2d512c2e9fb4de56c42a4182a5e74aa790d05bff31270c46880b5b0263128595381ef1c341ccf333e0d0c1ce9b35f3da6b2b3459ad4e1d52cd9913d670aa7ca2')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's|use_2to3=True,||g' setup.py
}

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

